<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('专业机房五列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <p>场所代码：</p>
                                <input type="text" name="placeCode"/>
                            </li>
                            <li>
                                <p>仪器名称：</p>
                                <input type="text" name="equipName"/>
                            </li>
                            <li>
                                <p>仪器编号：</p>
                                <input type="text" name="equipCode"/>
                            </li>
                            <li>
                                <p>分类号：</p>
                                <input type="text" name="equipSort"/>
                            </li>
                            <li>
                                <p>型号：</p>
                                <input type="text" name="equipModel"/>
                            </li>
                            <li>
                                <p>规格：</p>
                                <input type="text" name="equipNorms"/>
                            </li>
                            <li>
                                <p>国别：</p>
                                <input type="text" name="equipNation"/>
                            </li>
                            <li>
                                <p>厂家：</p>
                                <input type="text" name="equipFirm"/>
                            </li>
                            <li>
                                <p>出厂号：</p>
                                <input type="text" name="equipFirmid"/>
                            </li>
                            <li class="select-time">
                                <p>出厂日期：</p>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginEquipFirmdate]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endEquipFirmdate]"/>
                            </li>
                            <li class="select-time">
                                <p>购置日期：</p>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginEquipBuydate]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endEquipBuydate]"/>
                            </li>
                            <li>
                                <p>领用人：</p>
                                <input type="text" name="equipUname"/>
                            </li>
                            <!-- <li>
                                <p>场所名称：</p>
                                <select name="equipType" th:with="type=${@dict.getType('lab_all_name')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li> -->
                            <li>
                                <p>设备状态：</p>
                                <select name="equipStatus" th:with="type=${@dict.getType('sys_equip_status')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <p>仪器个数：</p>
                                <input type="text" name="equipNum"/>
                            </li>
                            <li>
                                <p>ip网段：</p>
                                <input type="text" name="ip"/>
                            </li>
                            <li>
                                <p>灭火器个数：</p>
                                <input type="text" name="fireNum"/>
                            </li>
                            <li>
                                <p>灭火器状态：</p>
                                <select name="fireState" th:with="type=${@dict.getType('sys_use_status')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="lab:major_five:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="lab:major_five:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="lab:major_five:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="lab:major_five:export">
                    <i class="fa fa-download"></i> 导出
                 </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('lab:major_five:edit')}]];
        var removeFlag = [[${@permission.hasPermi('lab:major_five:remove')}]];
        var equipTypeDatas = [[${@dict.getType('lab_all_name')}]];
        var equipStatusDatas = [[${@dict.getType('sys_equip_status')}]];
        var fireStateDatas = [[${@dict.getType('sys_use_status')}]];
        var prefix = ctx + "lab/major_five";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "专业机房五",
                columns: [{
                    checkbox: true
                },
                {
                    field : 'equipId', 
                    title : 'ID',
                    visible: false
                },
                {
                    field : 'placeCode', 
                    title : '实验室场所代码'
                },
                {
                    field : 'equipName', 
                    title : '仪器名称'
                },
                {
                    field : 'equipCode', 
                    title : '仪器编号'
                },
                {
                    field : 'equipSort', 
                    title : '分类号'
                },
                {
                    field : 'equipModel', 
                    title : '型号'
                },
                {
                    field : 'equipNorms', 
                    title : '规格'
                },
                {
                    field : 'equipNation', 
                    title : '国别'
                },
                {
                    field : 'equipFirm', 
                    title : '厂家'
                },
                {
                    field : 'equipFirmid', 
                    title : '出厂号'
                },
                {
                    field : 'equipFirmdate', 
                    title : '出厂日期'
                },
                {
                    field : 'equipBuydate', 
                    title : '购置日期'
                },
                {
                    field : 'equipUname', 
                    title : '领用人'
                },
                {
                    field : 'equipType', 
                    title : '实验室场所名称',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(equipTypeDatas, value);
                    }
                },
                {
                    field : 'equipStatus', 
                    title : '设备状态',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(equipStatusDatas, value);
                    }
                },
                {
                    field : 'equipNum', 
                    title : '仪器个数'
                },
                {
                    field : 'ip', 
                    title : 'ip网段'
                },
                {
                    field : 'fireNum', 
                    title : '灭火器个数'
                },
                {
                    field : 'fireState', 
                    title : '灭火器状态',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(fireStateDatas, value);
                    }
                },
                {
                    field : 'labReport', 
                    title : '实验室报告'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.equipId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.equipId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>